package com.zalej.cxxy;

import java.lang.reflect.Array;
import java.util.*;


public class ClassNine {


    public void LinkListStackPush(LinkedList ll, String s){
        ll.addLast(s);
    }
    public void LinkListStackPop(LinkedList ll, String s){
        ll.removeLast();
    }


    public static void main(String[] args){
        ArrayList al = new ArrayList();
        al.add("abc");
        al.add("123");
        al.add("hahha");
        al.add("abc");
        int LS=1;


        for (int i =0; i < LS; i++){
            if (al.get(i).toString().equals("abc")){
                al.remove(i);
                LS = al.size();
            }
        }

        for (int i = 0; i < al.size(); i++){
            System.out.println(al.get(i).toString());
        }



        HashMap hm = new HashMap();
        hm.put("南京大叭信息科技有限公司","17302526925");
        hm.put("百度","12345");
        hm.put("苹果","33456");

        hm.remove("苹果");

        Set set = hm.entrySet();

        Iterator i1 = set.iterator();
        while (i1.hasNext()){
            Map.Entry m = (Map.Entry)i1.next();
            if (m.getKey().toString().equals("百度"))
            System.out.println(m.getKey()+"    "+m.getValue());

        }



        String text = "Java is certainly a good programming language. Java was never just a language.Java is a whole plantform. Java has a lot of nice language features. Java 2D was designed so that simple operations are simple and complex operations are feasible.";
        char[] textc = text.toCharArray();

        int JavaNumber = 0;
        int languageNumber = 0;
        int simpleNumber = 0;
        for (int i = 0; i < text.length(); i++){
            if (text.charAt(i)=='J' && i<text.length()-4) {
                if (text.substring(i,i+4).equals("Java"))   {JavaNumber++;}
            }
            if (text.charAt(i)=='l' && i<text.length()-8) {
                if (text.substring(i,i+8).equals("language"))   {languageNumber++;}
            }
            if (text.charAt(i)=='s' && i<text.length()-5) {
                if (text.substring(i,i+6).equals("simple"))   {simpleNumber++;}
            }
        }

        int[] iiiiiiii = {JavaNumber, languageNumber, simpleNumber};

        Arrays.sort(iiiiiiii);

        for (int i = iiiiiiii.length-1; i >-1; i--){
            System.out.println(iiiiiiii[i]);
        }










        

    }
}
